package com.xixi.utils;

public class CurrentUser {
    private static final ThreadLocal<Integer> CURRENT_LOCAL = new ThreadLocal<>();
    private static final ThreadLocal<String> CURRENTROLE_LOCAL = new ThreadLocal<>();
    private static final ThreadLocal<String> CURRENTNAME_LOCAL = new ThreadLocal<>();
    public static void setCurrentId(Integer Id) {
        CURRENT_LOCAL.set(Id);
    }
    public static Integer getCurrentId() {
        return CURRENT_LOCAL.get();
    }
    public static void setCurrentRole(String role) {
        CURRENTROLE_LOCAL.set(role);
    }
    public static String getCurrentRole() {
        return CURRENTROLE_LOCAL.get();
    }
    public static void setCurrentName(String name) {
        CURRENTNAME_LOCAL.set(name);
    }
    public static String getCurrentName() {
        return CURRENTNAME_LOCAL.get();
    }
    public static void remove() {
        CURRENT_LOCAL.remove();
        CURRENTROLE_LOCAL.remove();
        CURRENTNAME_LOCAL.remove();
    }
}
